// Copyright (c) The Amphitheatre Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/// The configuration parameters for the application.
///
/// These can either be passed on the command line, or pulled from environment variables.
/// The latter is preferred as environment variables are one of the recommended ways to
/// get configuration from Kubernetes Secrets in deployment.
///
/// This is a pretty simple configuration struct as far as backend APIs go. You could imagine
/// a bunch of other parameters going here, like API keys for external services
/// or flags enabling or disabling certain features or test modes of the API.
///
/// For development convenience, these can also be read from a `.env` file in the working
/// directory where the application is started.
///
/// See `.env.sample` in the repository root for details.
#[derive(clap::Parser)]
pub struct Config {
    /// The name of the Kubernetes namespace that Amphitheatre is
    /// currently running in, the default is `amp-system`
    #[clap(long, env = "AMP_NAMESPACE", default_value = "amp-system")]
    pub namespace: String,

    /// The name of the ServiceAccount that Amphitheatre is
    /// currently using, the default is `default`.
    #[clap(long, env = "AMP_SERVICE_ACCOUNT_NAME", default_value = "default")]
    pub service_account_name: String,

    /// The NATS URL.
    #[clap(long, env = "AMP_NATS_URL")]
    pub nats_url: String,

    /// Persistent Volume storage class name, the default is `standard`.
    #[clap(long, env = "AMP_PV_STORAGE_CLASS_NAME", default_value = "standard")]
    pub pv_storage_class_name: String,

    /// Persistent Volume access mode, the default is `ReadWriteOnce`.
    #[clap(long, env = "AMP_PV_ACCESS_MODE", default_value = "ReadWriteOnce")]
    pub pv_access_mode: String,
}
